package nci60.data.protein

import nci60.project.*

/**
 * Implementation of the reference to an Uniprot SwissProt databases entry
 * Because the proteins in the IPI database result through clustering several databases together, one cluster references to several entries in other databases. 
 * To store these references consistently, the {@link nci60.data.protein.ProteinReference} class serves as parent class from which all other database classes are derived, whereat each database has its own attributes for accessing the entries. <p />
 * For every protein in the database exists at least one reference to an database, to be more precise, to the database from which the sequence is derived. 
 * This references are called master entries and are accessible via the sourceReferences property of the {@link nci60.data.protein.Protein} class. 
 * The remaining references belonging to that cluster are accessible by the reverenceIds property.
 *
 * @autor <a href="mailto:Florian.J.Auer@googlemail.com">Florian J. Auer</a>
*/
class ProteinUniprotSwissProt extends ProteinReference{

    /**
    * uniprot accession number
    */
    String acNumber
	
    /**
     * GRAILS <a href="http://grails.org/doc/latest/guide/single.html#constraints" target="_blank">Declaring Constraints</a>
     * <p />
     * Constraints in Grails are a way to declaratively specify validation rules for generating objects in GORM.
     */	
    static constraints = {
    }
	
    /**
     * GRAILS default representation of the object as String
     * @return String representation of the object
     */	
    String toString() {
            return "$DBname: $acNumber"
    }

    
    /**
    * Generates a html link to the entry in the uniprot swissprot database <p />
    * This method will be overwritten for each inherited class (and therefore for each source database)
    * @return   html link as String
    */
    String link() {
            return "$DBname: \t<a target=\"_blank\" href=\"http://www.uniprot.org/uniprot/$acNumber\">$acNumber</a>"
    }
}
